(function () {
    "use strict";

    var students = [{
        firstName: 'Петър',
        lastName: 'Петров'
        }, {
        firstName: 'Иван',
        lastName: 'Иванов'
    }, {
        firstName: 'Петър',
        lastName: 'Иванов'
    }, {
        firstName: 'Иван',
        lastName: 'Петров'
    }, {
        firstName: 'Георги',
        lastName: 'Раковски'
    }];

    function getStudentsWithFirstBeforeLastName(students) {
        return _.chain(students)
                .filter(function (student) {
                    return student.firstName < student.lastName;
                });
    }

    var finalResult =
        _.chain(getStudentsWithFirstBeforeLastName(students))
            .sortBy('firstName')
            .value();

    console.log(finalResult);
}());